#include <iostream>
using namespace std;

int main(){
	int n;
	int k;
	cin >> n >> k;
	int result = 0;
	for(int i = 1; i <= n; i++){
		int count = 0;
		while(1){
			int temp;
			cin >> temp;
			if(temp != 0)
				count++;
			else{
				if(count >= k)
					result++;
				break;
			}
		}
	}
	cout << result << endl;
}

